<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>用户信息</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <link rel="shortcut icon" href="/favicon.ico">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <link rel="stylesheet" href="./css/sm.min.css">
    <link rel="stylesheet" href="./css/sm-extend.min.css">
   <link href="../css/flickerplate.css"  type="text/css" rel="stylesheet">
   <link href="../css/zukeKongjian.css" rel="stylesheet">
   <script src="../js/jquery-2.1.1.js"></script>
   
	<link rel="stylesheet" type="text/css" href="../css/style.css"/>
	<link rel="stylesheet" type="text/css" href="../css/weui/example.css">
	<link rel="stylesheet" type="text/css" href="../css/weui/weui.css" />
	<script type="text/javascript" src="../js/bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="../js/common.js"></script>
   
   
   <script src="../js/min/modernizr-custom-v2.7.1.min.js" type="text/javascript"></script>
   <script src="../js/min/hammer-v2.0.3.min.js" type="text/javascript"></script>
   <script src="../js/min/flickerplate.min.js" type="text/javascript"></script>
   <script src="./js/home.js"></script>
   <script src="./js/zepto.js"></script>
	<script src="./js/sm.js" ></script>
  </head>
  
  <body>
	  <header class="bar bar-nav">
	    <a class="button button-link button-nav pull-left" href="javaScript:history.go(-1)" data-transition='slide-out'>
	      <span class="icon icon-left"></span>
	      返回
	    </a>
	    <h1 class="title">用户信息</h1>
	  </header>
    
  <div class="content">
  <div class="toubu">
   <!--  <a><img src="../images/shezhi.png" style="width: 25px;float: right;margin: 10px 10px 10px 0px;" ></a> -->
    <ul>
    <li><img src="../images/touxiang.png" style="width: 60px;height: 58px;" id="headimg"></li>
    <li><span id="name"></span></li>
    </ul>
    </div>

    <div class="list-block" >
    <ul>
      <li class="item-content">
        <div class="item-media"><i class="icon icon-f7"></i></div>
        <div class="item-inner">
          <div class="item-title">昵称</div>
          <div class="item-after" id="nickName"></div>
        </div>
      </li>
      <li class="item-content">
        <div class="item-media"><i class="icon icon-f7"></i></div>
        <div class="item-inner">
          <div class="item-title">手机号码</div>
          <div class="item-after" id="phone"></div>
        </div>
      </li>
      <li class="item-content" onclick="toLink('findPassword.html', this)">
        <div class="item-media"><i class="icon icon-f7"></i></div>
        <div class="item-inner">
          <div class="item-title">修改密码</div>
          <div class="item-after" ></div>
        </div>
      </li>
    </ul>
</div>
<!-- <jsp:include page="./footer.jsp"></jsp:include> -->
<script type="text/javascript">
var storage=window.localStorage;
var userId = $.getUrlParam("userId");
window.$$=window.Zepto = Zepto;

$(function() {
	getUserInfo();
});

function  getUserInfo(){
	
	$$.showPreloader("加载中");
	$.ajax({
		type : "POST",
		dataType : 'json',
		url : "../user/getById",
		data : {
			userId: userId
		},
		success : function(data) {
			$$.hidePreloader();
			console.log(data);
			var html="";
			if(data!=null ){
				var flag="";
				if(data.flag==0) flag="租客";
				if(data.flag==1) flag="房东";
				if(data.flag==2) flag="管家";
				$("#nickName").text( (data.nickName||"")+"("+flag+")");
				$("#phone").text(data.phone);
				$("#headimg").attr("src", (data.headImg||"../images/headboy.png") );
			}else{
				
			}
		},
		error: function(){
			$$.hidePreloader();
		}
	});
	
}
function toLink(txt,tagrt) {
	document.location.href = "./" + txt;
}
</script>
  </body>
</html>